<template>
    <div>
        <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/' }">
                首页
            </el-breadcrumb-item>
            <el-breadcrumb-item v-if="parentName">
                <a href="javascript:void(0);">{{ t('menu.'+parentName) }}</a>
            </el-breadcrumb-item>
            <el-breadcrumb-item>
                <a href="javascript:void(0);">{{ t('menu.'+route.meta.name) }}</a>
            </el-breadcrumb-item>
        </el-breadcrumb>
        <div style="padding:15px 0">
            <slot></slot>
        </div>
    </div>
</template>
<script setup>
const route = useRoute()
const { t } = useI18n();
import { menuTreeData } from '@/mock/data.js'
const parentPath = route.path.substring(0,route.path.indexOf('/',2))
const parentName = menuTreeData.find(obj=>obj.path==parentPath).name


</script>

<style>

</style>